﻿const information = [
  {
    path: '/',
    redirect: '/information/workbench',
  },
  {
    path: '/information',
    name: '个人中心',
    icon: 'smile',
    routes: [
      {
        path: '/information/workbench',
        name: '工作台',
        icon: 'smile',
        component: './information/workbench'
      },
      {
        path: '/information/message',
        name: '我的消息',
        icon: 'smile',
        component: './information/message'
      },
      {
        path: '/information/accountInformation',
        name: '账户信息',
        icon: 'smile',
        component: './information/accountInformation'
      },
      {
        path: '/information/securitySettings',
        name: '安全设置',
        icon: 'smile',
        component: './information/securitySettings'
      }
    ]
  }
];

const publishingCenter = [
  {
    path: '/publishingCenter',
    name: '发稿中心',
    icon: 'send',
    routes: [
      {
        path: '/publishingCenter/mediaResources',
        name: '媒体资源',
        icon: 'smile',
        component: './publishingCenter/mediaResources'
      },
      {
        path: '/publishingCenter/publishManuscript',
        name: '发布稿件',
        icon: 'smile',
        component: './publishingCenter/publishManuscript'
      },
      {
        path: '/publishingCenter/myOrder',
        name: '我的订单',
        icon: 'smile',
        component: './publishingCenter/myOrder',
        routes: [
          {
            path: '/publishingCenter/myOrder/:id',
            icon: 'smile',
            component: './publishingCenter/myOrder'
          }
        ]
      }
    ]
  }
];

const moneyManagement = [
  {
    path: '/moneyManagement',
    name: '资金管理',
    icon: 'payCircle',
    routes: [
      {
        path: '/moneyManagement/fundingDetails',
        name: '资金明细',
        icon: 'smile',
        component: './moneyManagement/fundingDetails'
      },
      {
        path: '/moneyManagement/myEnvelope',
        name: '我的红包',
        icon: 'smile',
        component: './moneyManagement/myEnvelope'
      },
      {
        path: '/moneyManagement/recharge',
        name: '账户充值',
        icon: 'smile',
        component: './moneyManagement/recharge'
      },
      {
        path: '/moneyManagement/invoiceRequest',
        name: '发票申请',
        icon: 'smile',
        component: './moneyManagement/invoiceRequest'
      },
      {
        path: '/moneyManagement/myScores',
        name: '我的积分',
        icon: 'smile',
        component: './moneyManagement/myScores'
      }
    ]
  }
];

const mediaCenter = [
  {
    path: '/mediaCenter',
    name: '媒介中心',
    icon: 'star',
    routes: [
      {
        path: '/mediaCenter/orderProcessing',
        name: '订单处理',
        icon: 'smile',
        component: './mediaCenter/orderProcessing'
      },
      {
        path: '/mediaCenter/revenueManagement',
        name: '收益管理',
        icon: 'smile',
        component: './mediaCenter/revenueManagement'
      },
      {
        path: '/mediaCenter/myResources',
        name: '资源管理',
        icon: 'smile',
        component: './mediaCenter/myResources',
        routes: [
          {
          path: '/mediaCenter/myResources',
          redirect: '/mediaCenter/myResources/list',
        },
          {
            path: '/mediaCenter/myResources/create',
            icon: 'smile',
            component: './mediaCenter/myResources/component/create'
          },
          {
            path: '/mediaCenter/myResources/list',
            icon: 'smile',
            component: './mediaCenter/myResources/component/list'
          }
        ]
      }  
    ]
  }
];

const contactUs = [
  {
    path: '/contactUs',
    name: '联系我们',
    icon: 'whatsApp',
    routes: [
      {
        path: '/contactUs/customerService',
        name: 'QQ客服',
        icon: 'smile',
        component: './contactUs/customerService'
      },
      {
        path: '/contactUs/wxService',
        name: '微信客服', 
        icon: 'smile',
        component: './contactUs/wxService'
      }
    ]
  }
]

export default [
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: './user/login',
      },
      
    ],
  },
  {
    path: '/modelPage/fuwutiaokun',
    component: './modelPage/fuwutiaokun',
  },
  {
    path: '/modelPage/yins',
    component: './modelPage/yins',
  },
  {
    path: '/modelPage/noticeForPublication',
    component: './modelPage/noticeForPublication',
  },
  {
    path: '/info',
    component: '../layouts/RegisterLayout', 
    routes: [
      {
        name: 'register',
        path: '/info/register',
        component: './user/register',
      },
      {
        name: 'reset',
        path: '/info/reset',
        component: './user/reset',
      },
      {
        name: 'entry',
        path: '/info/entry',
        component: './user/entry',
      }
    ]
  },
  {
    path: '/',
    component: '../layouts/SecurityLayout',
    routes: [
      {
        path: '/',
        component: '../layouts/BasicLayout',
        authority: ['admin', 'user'],
        routes: [
          ...information,
          ...publishingCenter,
          ...moneyManagement,
          ...mediaCenter,
          ...contactUs,
          {
            component: './404',
          },
        ],
      },
      {
        component: './404',
      },
    ],
  },
  {
    component: './404',
  },
];
